package com.duartepeixinho.P3D.Materials 
{
	import com.duartepeixinho.P3D.Core.Geom.Face3;
	import flash.display.Graphics;
	import flash.geom.Point;
	/**
	 * P3D
	 * @version 0.1
	 * @author Duarte Peixinho
	 */
	public class BitmapColorMaterial extends Materials implements IMaterials
	{
		
		public function BitmapColorMaterial(color:Number = 0xFF00FF, doubleSided:Boolean = false) 
		{
			this.color = color;
			this.doubleSided = doubleSided;
		}
		
		override public function drawTriangle(tri:Face3,A:Point,B:Point,C:Point,graphics:Graphics):void 
		{
			graphics.lineStyle(0, color);
			graphics.beginFill(color);
			graphics.moveTo(A.x, A.y);
			graphics.lineTo(B.x, B.y);
			graphics.lineTo(C.x, C.y);
			graphics.lineTo(A.x, A.y);
			graphics.endFill();
		}
		
	}

}